package fr.aprr.odyssee.server.domain.entities;

// default package
// Generated Apr 23, 2014 11:01:50 PM by Hibernate Tools 4.0.0

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * PP generated by hbm2java
 */
@Entity
@Table(name = "ody$conf_pp", schema = "public")
public class PP implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private PPId id;
	private Autoroute autoroute;

	public PP() {
	}

	public PP(PPId id) {
		this.id = id;
	}

	public PP(PPId id, Autoroute autoroute) {
		this.id = id;
		this.autoroute = autoroute;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "nomPp", column = @Column(name = "nom_pp", length = 60)),
			@AttributeOverride(name = "nomTypePp", column = @Column(name = "nom_type_pp", length = 30)),
			@AttributeOverride(name = "autoroute", column = @Column(name = "autoroute", length = 8)),
			@AttributeOverride(name = "sens", column = @Column(name = "sens", length = 8)),
			@AttributeOverride(name = "pkDebut", column = @Column(name = "pk_debut", precision = 8, scale = 8)),
			@AttributeOverride(name = "pkFin", column = @Column(name = "pk_fin", precision = 8, scale = 8)),
			@AttributeOverride(name = "demiTourOk", column = @Column(name = "demi_tour_ok", length = 3)),
			@AttributeOverride(name = "pkSensInv", column = @Column(name = "pk_sens_inv", precision = 8, scale = 8)),
			@AttributeOverride(name = "tpsTours", column = @Column(name = "tps_tours")),
			@AttributeOverride(name = "latitude", column = @Column(name = "latitude", precision = 8, scale = 8)),
			@AttributeOverride(name = "longitude", column = @Column(name = "longitude", precision = 8, scale = 8)),
			@AttributeOverride(name = "coteLong", column = @Column(name = "cote_long", length = 2)),
			@AttributeOverride(name = "affiche2d", column = @Column(name = "affiche2d", length = 3)) })
	public PPId getId() {
		return this.id;
	}

	public void setId(PPId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "autoroute", insertable = false, updatable = false)
	public Autoroute getAutoroute() {
		return this.autoroute;
	}

	public void setAutoroute(Autoroute autoroute) {
		this.autoroute = autoroute;
	}

}
